package com.example.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.example.web.entity.Account;

@RestController
public class SimpleController {

	@Autowired
	RestTemplate restTemplate;
	
	@RequestMapping(value = "/account/login", method = RequestMethod.POST)
	@ResponseBody
	public String login(Account loginInfo) {
		ResponseEntity<String> response = restTemplate.postForEntity("http://MONO-ESHOP-MICRO-LOGIN/account/login", loginInfo, String.class);
		return response.getBody();
	}
}
